package com.woniuxy.yoga.commons.core.util;

public class FileUtil {
    public static boolean isPdf(byte[] header) {
        return header[0] == 0x25 && header[1] == 0x50 && header[2] == 0x44 && header[3] == 0x46;
    }

    public static boolean isGif(byte[] header) {
        return header[0] == 'G' && header[1] == 'I' && header[2] == 'F' && header[3] == '8';
    }

    public static boolean isPng(byte[] header) {
        return header[0] == (byte) 0x89 && header[1] == (byte) 0x50 && header[2] == (byte) 0x4E
                && header[3] == (byte) 0x47;
    }

    public static boolean isJpg(byte[] header) {
        return header[0] == (byte) 0xFF && header[1] == (byte) 0xD8;
    }
}
